package yicheng.dinnertogetherapp;

import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import yicheng.dinnertogetherapp.R;

public class FriendManagerActivity extends Activity{
	Button addFriend_button, friendRequest_button, addFriendByContact_button;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.friend_manager_view);

		addFriend_button = (Button) findViewById(R.id.addFriend_button);
		friendRequest_button = (Button) findViewById(R.id.friendRequest_button);
		addFriendByContact_button = (Button) findViewById(R.id.addFriend_by_contact_button);

		addFriend_button.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent gotoAddFriendActivityIntent = new Intent("yicheng.dinnertogetherapp.ADDFRIENDACTIVITY");
				
				startActivity(gotoAddFriendActivityIntent);
			
			}
		});
		
		
		
		friendRequest_button.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent gotoFriendRequestListIntent = new Intent("yicheng.dinnertogetherapp.FRIENDREQUESTLISTACTIVITY");
				startActivity(gotoFriendRequestListIntent);
				
			}
		});
		
		
		addFriendByContact_button.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent gotoContactListIntent = new Intent("yicheng.dinnertogetherapp.CONTACTLISTACTIVITY");
				startActivity(gotoContactListIntent);
				
				
				
			}
		});
		

	}


	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		moveTaskToBack(true);
	}



	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		if (keyCode == KeyEvent.KEYCODE_BACK ) {
			//preventing default implementation previous to 
			//android.os.Build.VERSION_CODES.ECLAIR
			moveTaskToBack(true);

			return false;
		}     
		return super.onKeyDown(keyCode, event);    

	}


}
